//
//  MarksView.m
//  iMarks
//
//  Created by Christian Speich on 02.01.08.
//  Copyright 2008 Christian Speich. All rights reserved.
//

#import "MarksView.h"
#import "SubjectsManager.h"

@implementation MarksView

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        navigationBar = [[UINavigationBar alloc] initWithFrame: 
						 CGRectMake(0.0f, 0.0f, frame.size.width,
									[UINavigationBar defaultSize].height)];
		
		transitionView = [[UITransitionView alloc] initWithFrame:
						  CGRectMake(0.0f, [UINavigationBar defaultSize].height,
									 frame.size.width, frame.size.height -
									 [UINavigationBar defaultSize].height)];
		
		viewManager = [[ViewManager alloc] initWithTransitionView:transitionView 
												 andNavigationBar:navigationBar
													  andMainView:self];
		
		subjectView = [[SubjectView alloc] initWithFrame:
					   CGRectMake(0.0f, 0.0f,
								  frame.size.width, frame.size.height -
								  [UINavigationBar defaultSize].height)
								  andSubjectsManager:[[SubjectsManager alloc] init]];
		
		[viewManager addView:subjectView];
		
		[self addSubview:navigationBar];
		[self addSubview:transitionView];
    }
    return self;
}

- (void) dealloc
{
	[navigationBar release];
	[transitionView release];
	[viewManager release];
	[subjectView release];

	[super dealloc];
}


@end
